package com.jingdianjichi.subject.common.enums;

import lombok.Getter;

/**
 * 分类类型枚举 1是一级分类 2是二级分类
 */
@Getter
public enum CategoryTypeEnum {
    PRIMARY(1,"一级分类"),
    SECOND(0,"二级分类");

    public int code;
    public String desc;
    CategoryTypeEnum(int code, String desc){
        this.code = code;
        this.desc = desc;
    }
    public static CategoryTypeEnum getByCode(int codeVal){
        for(CategoryTypeEnum resultCodeEnum : CategoryTypeEnum.values()){
            if(resultCodeEnum.code == codeVal){
                 return  resultCodeEnum;
            }
        }
        return null;
    }

}
